import request from "./request";

// 获取用户列表的接口
// interface UsersType {
//   username?: string;
// }
export const getUsersApi = (params: { username?: string }) =>
  request.get("/users/list", params);

// 获取分类项的数据的接口
export const getClassifyApi = () => request.get("/classify/types");

// 删除分类项的接口
export const removeClassifyApi = (data: { type: number }) =>
  request.post("/classify/types/remove", data);

// 新增分类项的接口
export const addClassifyApi = (data: { title: string }) =>
  request.post("/classify/types/add", data);

// 编辑分类项的接口
export const editClassifyApi = (data: { title: string; type: number }) =>
  request.post("/classify/types/edit", data);

// 获取轮播图的接口
export const getSwperApi = () => request.get("/swper/list");

// 删除轮播图的接口
export const removeSwperApi = (data: { id: number }) =>
  request.post("/swper/remove", data);

// 新增轮播图的接口
export const addSwperApi = (data: { url: string }) =>
  request.post("/swper/add", data);
